package com.leaves.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leaves.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: LEAVES
 * @Version 1.0
 * @Date: 2021年09月21日 13时14分00秒
 * @Description:
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {

    /**
     * 根据用户ID查询用户对应的角色ID列表
     *
     * @param userId 用户ID
     * @return
     */
    @Select("SELECT role_id FROM user_role WHERE user_id = #{userId}")
    List<String> selectRoleIdByUserId(@Param("userId") String userId);
}